package br.com.mynage.dominio;

import java.util.Date;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.OneToOne;
import javax.persistence.SequenceGenerator;
import javax.persistence.Table;
import javax.persistence.Transient;

import org.primefaces.model.StreamedContent;

@Entity
@Table(name="tarefa")
public class Tarefa {
	
	/**Chave primaria*/
	@Id
	@GeneratedValue(strategy = GenerationType.SEQUENCE, generator = "geral_seq")
    @SequenceGenerator(name = "tarefa_seq", sequenceName = "geral_seq")  
	@Column(name="id" , nullable=false)
	private int id;
	
	@ManyToOne
	@JoinColumn(name="id_sprint")
	private Sprint sprint;
	
	private String nome;
	
	@OneToOne
	@JoinColumn(name="id_usuario")
	private Usuario responsavel;
	
	@Column(name="descricao")
	private String descricao;
	
	@Column(name="data_inicial")
	private Date dataInicial;
	
	@Column(name="data_final")
	private Date dataFinal;
	
	private boolean finalizado;
	
	@Transient
	private StreamedContent arquivo;
	
	public Tarefa(){
		
	}

	public int getId() {
		return id;
	}

	public void setId(int id) {
		this.id = id;
	}
	
	public Sprint getSprint() {
		return sprint;
	}

	public void setSprint(Sprint sprint) {
		this.sprint = sprint;
	}

	public String getNome() {
		return nome;
	}

	public void setNome(String nome) {
		this.nome = nome;
	}

	public String getDescricao() {
		return descricao;
	}

	public void setDescricao(String descricao) {
		this.descricao = descricao;
	}

	public Date getDataInicial() {
		return dataInicial;
	}

	public void setDataInicial(Date dataInicial) {
		this.dataInicial = dataInicial;
	}

	public Date getDataFinal() {
		return dataFinal;
	}

	public void setDataFinal(Date dataFinal) {
		this.dataFinal = dataFinal;
	}

	public boolean isFinalizado() {
		return finalizado;
	}

	public void setFinalizado(boolean finalizado) {
		this.finalizado = finalizado;
	}

	public Usuario getResponsavel() {
		return responsavel;
	}

	public void setResponsavel(Usuario responsavel) {
		this.responsavel = responsavel;
	}

	public StreamedContent getArquivo() {
		return arquivo;
	}

	public void setArquivo(StreamedContent arquivo) {
		this.arquivo = arquivo;
	}
	
	 
	
	

	
	
}
